package com.imooc;

import jdk.nashorn.internal.ir.CallNode;
import org.junit.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @Date:2021/10/16/15:31
 * @Description:
 */
public class Collections {

    @Test
    public void test01(){
        ArrayList<Object> list = new ArrayList<>();

        list.add(123);
        list.add(457);
        list.add(-12);
        list.add(0);

        List<Object> list2 = Arrays.asList(new Object[list.size()]);
        java.util.Collections.copy(list2,list);

        System.out.println("list2 = " + list2);
    }

    @Test
    public void test02(){
        ArrayList<Object> objects = new ArrayList<>();

        List<Object> objects1 = java.util.Collections.synchronizedList(objects);

    }

}
